/**
 * @开发版权 
 * @项目名称 VFCloud-Rendering
 * @版本信息 v1.0
 * @开发人员 zhous
 * @开发日期 2023-02-21
 * @修订日期
 * @描述  ApplicationReadyEventListener
 */
package com.vf.cloud.common.listener;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import com.vf.cloud.server.render.RenderNMS;
import com.vf.cloud.server.render.cache.RNMSCache;


@Component
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {

	@Value("${spring.renderNMS.port}")
	private int inetPort;
	
	@Override
	public void onApplicationEvent(ApplicationReadyEvent contextReadyEvent) {
		RNMSCache.renderNMS=new RenderNMS(inetPort);
		if(RNMSCache.renderNMS!=null) {
			RNMSCache.renderNMS.run();
		}
	}

}
